<html>
<head>
    <meta charset="utf-8">
    <title>后台管理系统-<< title >></title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="<< url_for('static',filename='layui/css/layui.css',t='20180530-2') >>" media="all">
    <link rel="stylesheet" href="<< url_for('static',filename='layui/css/modules/layer/default/layer.css') >>"
          media="all">
    <link id="layuicss-layuiAdmin" rel="stylesheet" href="<< url_for('static',filename='css/admin.css') >>" media="all">
    <link id="layuicss-layuiAdmin2" rel="stylesheet" href="<< url_for('static',filename='css/admin_login.css') >>" media="all">
</head>
<body ryt13721="1" layadmin-themealias="default" class="layui-layout-body" style="">
<div id="LAY_app" class="layadmin-tabspage-none">
    <div class="layadmin-user-login layadmin-user-display-show" id="LAY-user-login">
        <div class="layadmin-user-login-main">
            <div class="layadmin-user-login-box layadmin-user-login-header"><h2>魔都子沐</h2>
                <p>后台管理系统</p></div>
            <div class="layadmin-user-login-box layadmin-user-login-body layui-form"><< form.csrf_token >>
                <div class="layui-form-item"><label class="layadmin-user-login-icon layui-icon layui-icon-username"
                                                    for="LAY-user-login-username"></label><< form.username >>
                </div>
                <div class="layui-form-item"><label class="layadmin-user-login-icon layui-icon layui-icon-password"
                                                    for="LAY-user-login-password"></label><< form.password >>
                </div>
                <div class="layui-form-item">
                    << form.submit >>
                </div>
            </div>
        </div>
        <div class="layui-trans layadmin-user-login-footer"><p>©2021<a href="/" target="_blank">后台管理系统</a></p></div>
    </div>
    <script src="<< url_for('static',filename='layui/layui.js') >>" type="text/javascript"></script>
    <script>layui.use(['form'], function () {
        var $ = layui.$, form = layui.form;
        form.render();
        $('input').bind('keypress', function (event) {
            if (event.keyCode == "13") {
                $("#login-submit").click()
            }
        });
        form.on('submit(LAY-user-login-submit)', function (obj) {
            var login_loading = layer.load(2);
            $.ajax({
                url: '<< url_for("admin.Login",referer=referer) >>',
                data: obj.field,
                type: 'post',
                success: function (res) {
                    layer.close(login_loading);
                    if (res.status == 1) {
                        layer.msg('登入成功', {offset: '15px', icon: 1, time: 1000}, function () {
                            window.location.href = res.redirect ? res.redirect : '/admin/index'
                        })
                    } else {
                        layer.msg(res.info, {offset: '15px', icon: 2, time: 1000})
                    }
                }
            })
        });
        layer.msg('欢迎使用后台管理系统', {offset: '15px', icon: 1})
    });</script>
</div>
</body>
</html>